<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>组管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		function page(n,s){
			if(n) $("#pageNo").val(n);
			if(s) $("#pageSize").val(s);
			$("#searchForm").attr("action","${ctx}/app/mmsGroup/list");
			$("#searchForm").submit();
	    	return false;
	    }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/app/mmsGroup/list">组列表</a></li>
		<li><a href="${ctx}/app/mmsGroup/form">组${not empty mmsActivity.id?'修改':'添加'}</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="mmsGroup" action="${ctx}/app/mmsGroup/list" method="post" class="breadcrumb form-search ">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}" callback="page();"/>
		<ul class="ul-form">
			<li><label>ID：</label><form:input path="id" maxlength="50" class="input-medium"/></li>
			<li><label>组名称：</label><form:input path="name" maxlength="50" class="input-medium"/></li>
			<li><label>活动名称：</label>
			<form:select path="activeId" class="input-medium">
					<option value="">--请选择--</option>
					<form:options items="${activityList}" itemLabel="activityName" itemValue="id" htmlEscape="false"/>
			</form:select></li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" onclick="return page();"/>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead><tr><th class="sort-column id">ID</th><th class="sort-column name">组名称</th><th>位置</th><!-- <th>组长</th> --><th>活动名称</th><!-- <th>关联二维码数量</th> --><th>操作</th></tr></thead>
		<tbody>
		<c:forEach items="${page.list}" var="group">
			<tr>
				<td><a href="${ctx}/app/mmsGroup/form?id=${group.id}&activeId=${group.activeId }&remarks='1'">${group.id }</a></td>
				<td>${group.name}</td>
				<td>${group.proviceName }>${group.cityName }</td>
				<%-- <td>${group.mmsUserManagement.username}</td> --%>
				<td><%-- ${group.mmsActivity.activityName} --%>
				<c:forEach items="${activityList}" var="activity">
							<c:choose>
								<c:when test="${activity.id==group.activeId}">
									${activity.activityName}
								</c:when>
							</c:choose>
						</c:forEach></td>
				<%-- <td>${group.qrcodeNumber}</td> --%>
				<td>
    				<a href="${ctx}/app/mmsGroup/form?id=${group.id}">修改</a>
    				<a href="${ctx}/app/mmsGroup/memberListInGroup?&groupId=${group.id}&activeId=${group.activeId}">成员管理</a>
    				<a href="${ctx}/app/mmsGroup/addQrcodes?&groupId=${group.id}&activeId=${group.activeId}">二维码管理</a>
					<a href="${ctx}/app/mmsGroup/delete?groupId=${group.id}&activeId=${group.activeId}" onclick="return confirmx('确认要删除该组吗？', this.href)">删除</a>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>